package display2012;

import interfaces.IDisplay;
import it.unibo.is.interfaces.IBasicEnvAwt;

public class DisplayFactory {

	public static final String noGui = "noGui";

	protected String mode = "noGui";
	protected IBasicEnvAwt env = null;

	static final String swingDisplay = "swingDisplay";
	static final String guiView = "guiView";
	static final String guiPanel = "guiPanel";
	static final String viewContaKm = "viewContaKm";
	static final String guiContaKm = "guiContaKm";

	protected static DisplayFactory getFactory(String mode, IBasicEnvAwt env) {
		return new DisplayFactory(mode, env);
	}

	public DisplayFactory(String mode, IBasicEnvAwt env) {
		this.mode = mode;
		this.env = env;
	}

	public IDisplay makeDisplay() {
		if (mode.equals(noGui)) {
			return new DisplayStandardOut();
		} else if (mode.equals(swingDisplay)) {
			return new DisplaySwing();
		} else if (mode.equals(guiView)) {
			return new DisplayGui(env);
		} else if (mode.equals(guiPanel)) {
			IBasicEnvAwt env = null;
			return new DisplayGui(env);
		} else if (mode.equals(viewContaKm)) {
			return new DisplayGuiContaKm(env);
		} else if (mode.equals(guiContaKm)) {
			return new DisplayGuiContaKm(env);
		} else
			return null;

	}
}
